package com.czy.workflow.core.validator;

import com.czy.workflow.core.context.FlowContext;
import com.czy.workflow.core.model.TaskInfo;


public class FlowLoopValidator implements FlowValidator{

    @Override
    public boolean validate(FlowContext flowContext, TaskInfo taskInfo) {
        int max = flowContext.getFlowConfig().getLoopMax();
        if(max > 0){
            //获取节点loop_cnt
            int loop_cnt = 0;
            if(loop_cnt > max){
                return false;
            }

            loop_cnt += 1;
            //保存节点loop_cnt
        }
        return true;
    }


}
